import pymysql
db = pymysql.connect(host='localhost',
                     port=3306,
                     user='root',
                     password='123456',
                     database='jingdong',
                     charset='utf8'
                     )
cur = db.cursor()
sql = "create table if not ex"
cur.execute(sql)

db.commit()
cur.close()
db.close()